package com.alter.java.ai.langchain4j.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * 创建对话助手小智
 */
@AiService(
        wiringMode = EXPLICIT,//显式
        //chatModel = "qwenChatModel",//模型
        streamingChatModel = "qwenStreamingChatModel",//流式输出响应模型
        chatMemoryProvider = "chatMemoryProviderXiaoZhi",//聊天记忆提供者
        tools = "appointmentTools",//tools配置
        //contentRetriever = "contentRetrieverXiaoZhi"//配置向量存储（向量数据存储在内存中），具有检索外部知识库的能力
        contentRetriever = "contentRetrieverXiaoZhiPincone"//配置向量存储（向量数据存储在向量数据库Pincone中），具有检索外部知识库的能力
)
public interface XiaoZhiAgent {

    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
    //String chat(@MemoryId Long memoryId, @UserMessage String userMessage);
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage);

}
